package com.bx.market;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import java.util.List;

import com.bx.market.Event;

/**
 * Created by IntelliJ IDEA.
 * com.bx.user.User: nutej
 * Date: Jan 16, 2008
 * Time: 10:07:02 AM
 */
public class EventDAO extends HibernateDaoSupport {

    public Event getRecord(Long id) {
        return (Event) getHibernateTemplate().get(Event.class, id);
    }

    public List getRecords() {
        return getHibernateTemplate().find("from Event");
    }

    public void saveRecord(Event record) {
        getHibernateTemplate().saveOrUpdate(record);
    }

    public void removeRecord(Long id) {
        Object record = getHibernateTemplate().load(Event.class, id);
        getHibernateTemplate().delete(record);
    }
}
